<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="template/base.jsp" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>Project-input</title>
    <link rel="stylesheet" type="text/css" href="style/index.css" media="all">
    
    <script type="text/javascript" src="script/jquery.js"></script>
    <script type="text/javascript">
    	$(document).ready(function(){
    		$("#inbutton").click(function(){
    			$("#alluser option:selected").each(function(){
    				$("#hiddenUsers").val($("#hiddenUsers").val()+","+$(this).val());
    				$("#selectuser").append($(this));
    			});
    			
    			var v = $("#hiddenUsers").val();
    			if(v.indexOf(',') == 0){
    				v = v.substring(1,v.length);
    			}
    			$("#hiddenUsers").val(v);
    		});
    		
    		$("#outbutton").click(function(){
    			$("#hiddenUsers").val("");
    			$("#selectuser option:selected").each(function(){
    				$("#alluser").append($(this));
    			});
    			
    			$("#selectuser option").each(function(){
    				$("#hiddenUsers").val($("#hiddenUsers").val()+","+$(this).val());
    			});
    			
    			var v = $("#hiddenUsers").val();
    			if(v.indexOf(',') == 0){
    				v = v.substring(1,v.length);
    			}
    			$("#hiddenUsers").val(v);
    		});
    		
    		$("#show").click(function(){
    			alert($("#hiddenUsers").val());
    		});
    	});
    </script>
    
  </head>
  
  <body>
    <div id="body-wrapper"> n<!-- Wrapper for the radial gradient background -->
		
		<div id="sidebar">
			<%@include file="template/left.jsp" %>
		</div> <!-- End #sidebar -->
		
		<!-- 右边 -->
		
		<div id="main-content">
				
				<div class="content-box">
					<div class="nav">
						<a href="${basePath}/main.action">首页</a> > 创建项目
					</div>
				</div>
			
				
				
				<div class="content-box">
					<div class="content-box-header">
						<h3 style="cursor: s-resize;">创建新项目</h3>
					</div>
					<div class="content-box-content" style="padding-bottom: 10px;">
						<div style="display: block;" class="tab-content default-tab">
							
							<form action="project!save.action" method="post">
								<label>项目名称：</label>
								<input type="text" name="project.projectname" class="large-input"/>
								<label>项目成员：</label>
								
								<input type="hidden" id="hiddenUsers" name="users"  value="" />
								
								<select style="width:42%" size="10" multiple="multiple" id="alluser">
									<c:forEach items="${userList}" var="user">
										<option value="${user.id}">${user.username}</option>
									</c:forEach>
								</select>
								
								<input type="button" id="inbutton" value="添加"/>
								<input type="button" id="outbutton" value="移除"/>
								
								<select style="width:42%" size="10" multiple="multiple" id="selectuser">
								
								</select><br/>
								
								<input type="submit" class="button" value="保存" style="margin-top:20px"/>
								<input type="button" id="show" value="show"/>
							</form>
							
							
							
						</div>
					</div> 
				</div>
				
				
			
			<div id="footer">
				<small>
						© Copyright 2011 焦作凯盛信息技术有限公司 | Powered by <a href="http://www.kaishengit.com">凯盛软件</a> | <a href="#">Top</a>
				</small>
			</div>
			
		</div>
		
	</div>
  </body>
</html>
